#include <iostream> 
#include <vector>
#include <string>
using namespace std;


int main()
{
	string str;
	while(getline(cin,str))
	{
		int pos1,pos2;
		vector<string> ans;
		pos1=0;
		pos2=str.find_first_of(' ');
		while(pos2!=string::npos)
		{
			string temp;
			temp=str.substr(pos1,pos2-pos1);
			ans.push_back(temp);
			while(pos2<str.length()&&str[pos2]==' ') pos2++;
			if(pos2==str.length()) break;
			pos1=pos2;
			pos2=str.find_first_of(' ',pos1);
		}
		string t=str.substr(pos1);
		ans.push_back(t);
		int j=ans.size()-1;
		while(j>0) 
		{
			cout<<ans[j]<<" ";
			j--;
		}
		cout<<ans[0]<<endl;
		
		
	}
}
